<template>
	<view class="wrap">
		<view class="cartListItem"
			v-for="(item,index) in orderList"
			:key="index"
			@tap="goOrderDet(item.id)"
		>
			<view class="sellerName hasFlex">
				<view class="sellerImg">
					<image class="sellerImg" v-if="item.ogzHeadImg == ''" src="../../../../static/images/groupService/orgDef.png"></image>
					<image class="sellerImg" v-else :src="item.ogzHeadImg" lazy-load></image>
				</view>
				<view class="seller ellip">{{item.ogzName}}</view>
			</view>
			<view class="itemCon spaceBet">
				<view class="itemConImg">
					<image class="samePar" src="../../../../static/images/groupService/ttIimg.png"></image>
				</view>
				<view class="itemConDet">
					<view class="topCon ellip">{{item.groupName}}</view>
					<view class="midCon">服务项目{{item.serviceNum}}项</view>
					<view class="itemStatus">
						<view class="waitPay" v-if="item.payStatus == 0 && item.actMoney == 0">待支付(等待确认价格)</view>
						<view class="waitPay" v-if="item.payStatus == 0 && item.actMoney > 0">待支付</view>
						<view class="wait" v-if="item.payStatus == 1">待服务</view>
						<view class="hasComp" v-if="item.payStatus == 6">已完成</view>
						<view v-if="item.payStatus == 7">已取消</view>
						<!-- <view class="orderTime">{{item.addTime}}</view> -->
					</view>
					<view class="midCon specCol">{{item.addTime}}</view>
				</view>
			</view>
			<!-- 实付 --> 
			<view class="actPay spaceBet" v-if="item.payStatus != 7">
				<view class="actPayPrice">
					<block v-if="item.payStatus >= 1">
						实付<text class="unit">¥</text><text class="priceNum">{{item.actMoney}}</text>
					</block>
					<block v-else>
						<block v-if="item.actMoney > 0">
							应付<text class="unit">¥</text><text class="priceNum">{{item.actMoney}}</text>
						</block>
					</block>
				</view> 
				<view class="groupBtn hasFlex">
					<block v-if="item.payStatus == 0">
						<view class="setBtn cancel" @tap.stop="cancelOrder(item.id)">取消订单</view>
						<view class="setBtn fix" v-if="item.actMoney == 0" @tap.stop="goPay(item.id,item.actMoney)">去支付</view>
						<view class="setBtn fix" v-if="item.actMoney > 0" @tap.stop="goPay(item.id,item.actMoney)">去支付</view>
					</block>
					<!-- <view class="setBtn fix" @tap="setOrderPrice">去评价</view> -->
					<!-- <view class="setBtn viewDet" @tap="setOrderPrice">查看评价</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			orderList:Array,
			loading:Boolean
		},
		methods:{
			setOrderPrice(){
				this.$emit('setOrderPrice')
			},
			goOrderDet(orderId){
				this.$emit('goOrderDet',orderId);
			},
			goPay(orderId,actMoney){
				this.$emit('goPay',orderId,actMoney);
			},
			cancelOrder(orderId){
				this.$emit('cancelOrder',orderId);
			}
		}
	}
</script>

<style lang='scss' scoped>
	@import '@/static/scss/orderList.scss'
</style>